package org.reenscape.skill;

import org.reenscape.model.PacketParser;

public class Herblore {

			public void VialOnHerb(int HerbID, PacketParser p3){
				int Herblore = p3.playerLevel[p3.playerHerblore];
				int Add = 0;
				int Required;
				boolean NotFound = false;
				
				switch(HerbID){
					case 249: // Attack potion
					Add = 91;
					break;
					
					case 251: // Anti poison
					Add = 93;
					break;
					
					case 1534: // Relicym's balm
					Add = 4840;
					break;
					
					case 253: // Strength potion/Serum 207
					Add = 95;
					break;
					
					case 255: // Guthix balance and Stat restore and Energy
					Add = 97;
					break;
					
					case 257: // Defence potion/Prayer
					Add = 109;
					break;
					
					case 2998: // Agility potion/Saradomin brew
					Add = 3002;
					break;
					
					case 259: // Super attack potion /Super attack / Super anti-poison potions
					Add = 101;
					break;
					
					case 261: // Fishing potion and Super Energy Potion
					Add = 103;
					break;
					
					case 263: // Super Strength and Weapon Poison
					Add = 105;
					break;
					
					case 3000: // Super Stat restore potion
					Add = 3004;
					break;
					
					case 265: // Super defence potion
					Add = 107;
					break;
					
					case 2481: // Anti fire breath potion/Magic potion
					Add = 2483;
					break;
					
					case 267: // Ranging potion
					Add = 109;
					break;
					
					case 269: // Zammorak Brew
					Add = 111;
					break;					
					
					default:
					NotFound = true;
					break;
				}
				
				if(NotFound) return;
				
				p3.deleteItem(HerbID, p3.GetItemSlot(HerbID), 1);
				p3.addItem(Add, 1);
			}
			
			public void Finish(int Ingredient, int UnfinishedPot, PacketParser p3){
				int Herblore = p3.playerLevel[p3.playerHerblore];
				int Required = 0;
				int PotionID = 0;
				double XP = 0;
				
				if(Ingredient == 221 && UnfinishedPot == 91){ // Attack potion
				Required = 3;
				PotionID = 121;
				XP = 25;
				}
				else if(Ingredient == 235 && UnfinishedPot == 93){ // Anti-poison
				Required = 5;
				PotionID = 175;
				XP = 37.5;				
				}
				else if(Ingredient == 1526 && UnfinishedPot == 737){ // Relicym's balm
				Required = 8;
				PotionID = 4844;
				XP = 40;
				}
				else if(Ingredient == 225 && UnfinishedPot == 95){ // Strength Potion
				Required = 12;
				PotionID = 115;
				XP = 50;
				}
				else if(Ingredient == 592 && UnfinishedPot == 95){ // Serum 207
				Required = 15;
				PotionID = 3410;
				XP = 50;
				}
				else if(Ingredient == 223 && UnfinishedPot == 97){ // Stat restore Potion
				Required = 22;
				PotionID = 127;
				XP = 62.5;
				}
				else if(Ingredient == 1975 && UnfinishedPot == 97){ // Energy Potion
				Required = 26;
				PotionID = 3010;
				XP = 67.5;
				}
				else if(Ingredient == 239 && UnfinishedPot == 99){ // Defence Potion
				Required = 30;
				PotionID = 133;
				XP = 75;
				}
				else if(Ingredient == 2152 && UnfinishedPot == 3002){ // Agility Potion
				Required = 34;
				PotionID = 3034;
				XP = 80;
				}
				else if(Ingredient == 231 && UnfinishedPot == 99){ // Prayer Potion
				Required = 38;
				PotionID = 139;
				XP = 97.5;
				}
				else if(Ingredient == 221 && UnfinishedPot == 101){ // Super Attack Potion
				Required = 45;
				PotionID = 145;
				XP = 100;
				}
				else if(Ingredient == 235 && UnfinishedPot == 101){ // Super Anti-Poison Potion
				Required = 48;
				PotionID = 181;
				XP = 106;
				}
				else if(Ingredient == 231 && UnfinishedPot == 103){ // Fishing Potion
				Required = 50;
				PotionID = 151;
				XP = 113;
				}
				else if(Ingredient == 2970 && UnfinishedPot == 103){ // Super Energy Potion
				Required = 50;
				PotionID = 3018;
				XP = 117.5;
				}
				else if(Ingredient == 225 && UnfinishedPot == 105){ // Super Strength Potion
				Required = 55;
				PotionID = 157;
				XP = 125;
				}
				else if(Ingredient == 241 && UnfinishedPot == 105){ // Weapon Poison
				Required = 60;
				PotionID = 187;
				XP = 137.5;
				}
				else if(Ingredient == 3000 && UnfinishedPot == 223){ // Super Stat Restore Potion
				Required = 63;
				PotionID = 3026;
				XP = 142;
				}
				else if(Ingredient == 265 && UnfinishedPot == 107){ // Super Defence Potion
				Required = 66;
				PotionID = 163;
				XP = 150;
				}
				else if(Ingredient == 241 && UnfinishedPot == 2483){ // Anti Fire Breath Potion
				Required = 69;
				PotionID = 2454;
				XP = 158;
				}
				else if(Ingredient == 245 && UnfinishedPot == 109){ // Range Potion
				Required = 72;
				PotionID = 169;
				XP = 165;
				}
				else if(Ingredient == 3138 && UnfinishedPot == 2483){ // Magic Potion
				Required = 76;
				PotionID = 3042;
				XP = 172.5;
				}
				else if(Ingredient == 247 && UnfinishedPot == 111){ // Zamorak Brew
				Required = 78;
				PotionID = 189;
				XP = 175;
				}
				else if(Ingredient == 6993 && UnfinishedPot == 3002){ // Saradomin Brew
				Required = 81;
				PotionID = 6687;
				XP = 180;
				}
				else {
				return;
				}
				
				if(Herblore >= Required){
				p3.Animation(1238);
				p3.addSkillXP(XP, p3.playerHerblore);
				p3.deleteItem(Ingredient, p3.GetItemSlot(Ingredient), 1);
				p3.deleteItem(UnfinishedPot, p3.GetItemSlot(UnfinishedPot), 1);
				p3.addItem(PotionID, 1);
				}
				else {
				p3.sendMessage("You need a Herblore level of "+Required+" to make that potion.");
				}				
			}
}